<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link th:href="@{/css/element-index.css}" rel="stylesheet"/>
</head>
<body>
<div id="test1">

    <!-- 文件下载 -->
    <el-button  size="small" @click="downLoad('class.xlsx')">下载</el-button>

</div>
</body>

<script th:src="@{/js/vue.js}"></script>
<script th:src="@{/js/element-index.js}"></script>
<script>
    new Vue({
        el: '#test1',
        data:function () {
            return {
            }
        },
        methods: {
            //下载文件
            downLoad: function (val) {
                window.open("http://" + window.location.host + "/file/download?fileName=" + val, '_blank')
            }
        }
    });
</script>
</html>
